#define _CRT_SECURE_NO_WARNINGS
#include"SList.h"
void test1()
{
	SList* plist = NULL;
	SListNodePushBack(&plist, 3);
	SListNodePushBack(&plist, 3);
	SListNodePushBack(&plist, 1);
	SListNodePushBack(&plist, 4);
	SListNodePushBack(&plist, 8);
	SListNodeDisplay(plist);
	SListNodePopBack(&plist);
	SListNodePopBack(&plist);
	SListNodePopBack(&plist);
	SListNodeDisplay(plist);
	SListNodePopBack(&plist);
	SListNodePopBack(&plist);
	SListNodeDisplay(plist);
	SListNodePopBack(&plist);
}
void test2()
{
	SList* plist = NULL;
	SListNodePushFront(&plist, 3);
	SListNodePushFront(&plist, 2);
	SListNodePushFront(&plist, 3);
	SListNodePushFront(&plist, 1);
	SListNodePushFront(&plist, 3);
	SListNodePushFront(&plist, 3);
	SListNodeDisplay(plist);
	SList*ret = SListFind(plist,2);
	if (ret != NULL)
	{
		SListInsert(&plist, ret, 10);
	}
	SListNodeDisplay(plist);

}
void test3()
{
	SList* plist = NULL;
	SListInsertBack(&plist, NULL, 220);
	SListNodePushBack(&plist,1);
	SListNodePushBack(&plist,2);
	SListNodePushBack(&plist,3);
	SListNodePushBack(&plist,4);
	SListNodeDisplay(plist);
	SList* ret = SListFind(plist, 2);
	if (ret != NULL)
	{
		SListInsertBack(&plist, ret, 10);
	}
	SListNodeDisplay(plist);
	SListDestroy(&plist);
	SListNodePushBack(&plist, 1);
	SListNodePushBack(&plist, 2);
	SListNodePushBack(&plist, 3);
	SListNodePushBack(&plist, 4);
	SListNodeDisplay(plist);

}
int main()
{
	//test1();
	/*test2();*/
	test3();
	return 0;
}